package com.shen;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Author:shen
 * CreateDate:2020/5/28.
 * Function:
 */
public class demo01 {
    static Map<String,String> animal=new HashMap<String, String>();
    static Scanner scanner=new Scanner(System.in);
    static {
        animal.put("Dog","狗");
        animal.put("Cat","猫");
    }
    public static void main(String[] args) {
        System.out.println("请输入Dog或Cat单词：");
        String name=scanner.nextLine();
        String hanzi= animal.get(name.trim());
        if(hanzi==null){
            System.out.println("输入错误，请按提示输入！");
        }else{
            System.out.println(animal.get(name.trim()));
        }

    }

}
